{% set current_user_id = current_user and email2id(current_user['email']) %}
{% set isadmin = handler.has_permission("admin") %}
{% for task in tasks %}
<input id="{{ task.id }}" value="{{task.taskname}}" type="Hidden" class="quick_select_data">
<li class="task-item" data-task-id="{{ task.id }}">
  
  <div class="process-bar {{ task.status }}" style="width: {{ 100-task.process }}%"></div>
  
  <a class="get-lixian-url iframe" href="/get_lixian_url?task_id={{ task.id }}" target="_blank" title="{{ task.taskname }}">
      <div class="tname"><span class="p1">{% if task.invalid %}* {% end %}{{ len(task.taskname) > 15 and task.taskname[:-15] or task.taskname }}</span><span class="p2">{{ len(task.taskname) > 15 and task.taskname[-15:] or "" }}</span></div>
  </a>
  <div class="info">
      <span>
      <input id="tid-{{ task.id }}" class="select_task" type="checkbox" />
      <label for="{{ task.id }}" class="select_task" ></label>
      </span>
      <span class="file-size">{{ format_size(task.size) }}</span>
      <span class="date">{{ task.createtime.strftime("%Y-%m-%d") }}</span>
      
  </div>
  <div class="clearfix"></div>
  <div class="ext-info" style="display: none;">

  </div>
  <div class="clearfix"></div>
</li>
{% end %}
{% if tasks %}
<script>
  $(".get-lixian-url").fancybox({width: 700});
  $(".edit-button").fancybox({ width: 700 , height: 250});
  $(".task-item").hover(function() {
    $(this).find(".ext-info").delay(250).show(1);
  }, function() {
    $(this).find(".ext-info").stop(true, true).hide();
  });
  

</script>
{% end %}
